﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_PRODUCT.Product.DAO;

namespace ERP_RORZE_PRODUCT.Product.Incauhinh
{
    public partial class frm_LvlEdit : DevExpress.XtraEditors.XtraForm
    {
        public event EventHandler Reload;
        ClsIncauhinhDAO clsConfigureDAO = new ClsIncauhinhDAO();

        public string ID;
        public string Name;

        public frm_LvlEdit()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frm_LvlEdit_Load(object sender, EventArgs e)
        {
            txtPtype.Text = Name;
            txtKH.Text = ID;
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (txtPtype.Text == "")
            {
                MessageBox.Show("Chưa nhập tỷ trọng");
            }
            else 
            {
                clsConfigureDAO.UpdateLVL(txtKH.Text, txtPtype.Text);
                MessageBox.Show("Đã nhập xong");
                Reload(sender, e);
            }

        }
    }
}